/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80403 (8.4.3)
 Source Host           : 127.0.0.1:3306
 Source Schema         : gongdan

 Target Server Type    : MySQL
 Target Server Version : 80403 (8.4.3)
 File Encoding         : 65001

 Date: 21/03/2025 10:20:11
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for assembly_work_order
-- ----------------------------
DROP TABLE IF EXISTS `assembly_work_order`;
CREATE TABLE `assembly_work_order` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `code` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '装配工单编码',
  `work_order_num` int DEFAULT NULL COMMENT '工单数',
  `end_worker_order_num` int DEFAULT NULL COMMENT '已结束工单数',
  `planed_num` decimal(16,6) DEFAULT '0.000000' COMMENT '计划数',
  `finish_num` decimal(16,6) DEFAULT '0.000000' COMMENT '完工数',
  `other` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '自定义字段(json字符串)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_user` int DEFAULT NULL COMMENT '更新人(user表id)',
  `factory_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_code` (`code`(20)) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE,
  KEY `idx_create_user` (`create_user`) USING BTREE,
  KEY `idx_update_user` (`update_user`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=181 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='装配工单';

-- ----------------------------
-- Records of assembly_work_order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for assembly_work_order_detail
-- ----------------------------
DROP TABLE IF EXISTS `assembly_work_order_detail`;
CREATE TABLE `assembly_work_order_detail` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `assembly_work_order_id` bigint DEFAULT NULL COMMENT '装配工单id(assembly_work_order表id)',
  `worker_order_id` int DEFAULT NULL COMMENT '工单id(work_order表id)',
  `worker_order_code` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '工单编码',
  `unit_usage` decimal(14,6) DEFAULT NULL COMMENT '单位产品用量',
  `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '备注',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_user` int DEFAULT NULL COMMENT '更新人(user表id)',
  `factory_id` int DEFAULT NULL,
  `level` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '层级',
  `parent_level` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '父层级',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_assembly_work_order_id` (`assembly_work_order_id`) USING BTREE,
  KEY `idx_work_order_id` (`worker_order_id`) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='装配工单-工单关系表';

-- ----------------------------
-- Records of assembly_work_order_detail
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bad_product
-- ----------------------------
DROP TABLE IF EXISTS `bad_product`;
CREATE TABLE `bad_product` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(45) DEFAULT NULL COMMENT '编号',
  `name` varchar(45) DEFAULT NULL COMMENT '名称',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb3 COMMENT='不良品项';

-- ----------------------------
-- Records of bad_product
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for bom_info
-- ----------------------------
DROP TABLE IF EXISTS `bom_info`;
CREATE TABLE `bom_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '物料清单id',
  `parent_product_id` int DEFAULT NULL COMMENT '父产品id(product表id)\n',
  `child_product_id` int DEFAULT NULL COMMENT '子产品id(product表id)',
  `unit_usage` decimal(14,6) DEFAULT NULL COMMENT '单位产品用量',
  `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '备注',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_user` int DEFAULT NULL COMMENT '更新人(user表id)',
  `factory_id` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_parent_product_id` (`parent_product_id`) USING BTREE,
  KEY `idx_child_product_id` (`child_product_id`) USING BTREE,
  KEY `idx_create_user` (`create_user`) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=192 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='物料清单关系表';

-- ----------------------------
-- Records of bom_info
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for broadcast
-- ----------------------------
DROP TABLE IF EXISTS `broadcast`;
CREATE TABLE `broadcast` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '信息提醒id',
  `text` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '播报内容',
  `belong_module` tinyint DEFAULT NULL COMMENT '所属模块(0 报工)',
  `notice_time` datetime DEFAULT NULL COMMENT '通知时间',
  `round_num` int DEFAULT '1' COMMENT '轮数',
  `interval_time` int DEFAULT '3' COMMENT '间隔时间(分钟)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `factory_id` int DEFAULT NULL COMMENT '工厂ID',
  `state` tinyint DEFAULT '0' COMMENT '播报状态(0 未播报, 1 已播报)',
  `info_user` int DEFAULT NULL COMMENT '通知人',
  `relation_id` int DEFAULT NULL COMMENT '关联id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_belong_module` (`belong_module`) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE,
  KEY `idx_ relation_id` (`relation_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

-- ----------------------------
-- Records of broadcast
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for common_tree
-- ----------------------------
DROP TABLE IF EXISTS `common_tree`;
CREATE TABLE `common_tree` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '树结构类型id',
  `label` varchar(20) DEFAULT NULL COMMENT '标签',
  `value` varchar(10) DEFAULT NULL COMMENT '类型值',
  `parent_id` bigint DEFAULT NULL COMMENT '父类型id(无为0)',
  `sort` int DEFAULT NULL COMMENT '排序',
  `belong_module` int DEFAULT NULL COMMENT '所属模块(0 设备分组)',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `factory_id` int DEFAULT NULL,
  `create_user` varchar(64) DEFAULT '' COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_user` varchar(64) DEFAULT '' COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_label` (`label`) USING BTREE COMMENT '名称索引',
  KEY `idx_belong_module` (`belong_module`) USING BTREE COMMENT '所属模块索引'
) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='树结构表单';

-- ----------------------------
-- Records of common_tree
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for custom_event
-- ----------------------------
DROP TABLE IF EXISTS `custom_event`;
CREATE TABLE `custom_event` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '名称',
  `type` int DEFAULT NULL COMMENT '0/1/2\n工单/任务/报工',
  `custom_type` int DEFAULT NULL COMMENT '0/1\n数据变更/定时触发',
  `custom_data_type` int DEFAULT NULL COMMENT '数据变更类型时触发动作\n0/1/2\n新增/编辑/删除',
  `data_condition` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT '触发事件条件',
  `time` datetime DEFAULT NULL COMMENT '定时触发时触发时间',
  `time_type` int DEFAULT NULL COMMENT '重复方式\n0/1/2/3/4/\n执行一次/每天执行/每周同一天执行/每月同一天执行/每年同一天/',
  `search_condition` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT '定时触发时查询条件',
  `statistics_data` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT '统计数据',
  `event_type` int DEFAULT '0' COMMENT '0/1\n消息推送/数据变更',
  `push_object` int DEFAULT '0' COMMENT '执行对象',
  `user_id` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '推送对象',
  `dep_id` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `push_mess` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT '推送信息',
  `state` int DEFAULT '0' COMMENT '0/1\n启用/停用',
  `execute_form` int DEFAULT NULL COMMENT '执行事件类型为1数据变更时执行表单类型\n0/1\n工单/任务',
  `execute_event` int DEFAULT NULL COMMENT '执行事件\n0\n编辑数据',
  `filter_condition` int DEFAULT NULL COMMENT '过滤条件\n0/1/2\n执行表单为1任务时表示上一个任务/下一个任务/本道任务\n执行表单为0工单时0表示本工单',
  `execute_action` int DEFAULT NULL COMMENT '执行动作\n0/1\n执行表单为0工单时表示开始工单/结束工单\n执行表单为1任务时表示开始任务/结束任务\n',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='自定义事件';

-- ----------------------------
-- Records of custom_event
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for custom_field
-- ----------------------------
DROP TABLE IF EXISTS `custom_field`;
CREATE TABLE `custom_field` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL COMMENT '字段名',
  `chinese_name` varchar(45) DEFAULT NULL COMMENT '字段中文名',
  `field_type` varchar(45) DEFAULT NULL COMMENT '字段类型',
  `scan_code_input` tinyint(1) NOT NULL DEFAULT '0' COMMENT '允许扫码输入',
  `modify_scan_result` tinyint(1) NOT NULL DEFAULT '0' COMMENT '可修改扫码结果',
  `hidden` text COMMENT '隐藏条件',
  `field_attribute` varchar(128) DEFAULT NULL COMMENT '字段属性',
  `guide_text` varchar(128) DEFAULT NULL COMMENT '引导文字',
  `tips` varchar(256) DEFAULT NULL COMMENT '提示说明',
  `check_box` text COMMENT '复选框内容',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `create_id` int DEFAULT NULL,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `field_ascription` varchar(45) DEFAULT NULL COMMENT '字段归属',
  `business_object` varchar(45) DEFAULT NULL COMMENT '关联对象中业务对象\nunit/bad_product/product/processes/process_route/user\n',
  `show_field` text COMMENT '关联对象中显示字段',
  `fill_rule` text COMMENT '数据填充规则',
  `show_accuracy` varchar(45) DEFAULT NULL COMMENT '类型为时间时 时间精度',
  `object_field_id` int DEFAULT NULL COMMENT '关联属性中关联对象自定义字段id',
  `correlation_field` varchar(45) DEFAULT NULL COMMENT '关联属性中关联字段',
  `in_use` int NOT NULL DEFAULT '0' COMMENT '0/1\n未使用/使用中',
  `sort` int DEFAULT NULL COMMENT '排序',
  `formula` varchar(100) DEFAULT NULL COMMENT '公式',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb3 COMMENT='自定义字段';

-- ----------------------------
-- Records of custom_field
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for custom_number
-- ----------------------------
DROP TABLE IF EXISTS `custom_number`;
CREATE TABLE `custom_number` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL COMMENT '1/2/3/4/5/6/7/8/9/10/11\n销售订单/装配工单/生产计划/工单/入库单/出库单/产品定义/不良品项/工序/工艺路线/装配工单',
  `prefix` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '前缀',
  `time` int DEFAULT NULL COMMENT '1/2/3\n年/年月/年月日',
  `number` int DEFAULT NULL COMMENT '流水号',
  `now_num` int DEFAULT NULL COMMENT '当前流水号',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `custom_number_id_uindex` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='自定义编号规则';

-- ----------------------------
-- Records of custom_number
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for database_list
-- ----------------------------
DROP TABLE IF EXISTS `database_list`;
CREATE TABLE `database_list` (
  `id` int NOT NULL AUTO_INCREMENT,
  `url` text COMMENT '数据库连接url',
  `user` varchar(45) DEFAULT NULL COMMENT '账号',
  `password` varchar(128) DEFAULT NULL COMMENT '密码',
  `type` varchar(45) DEFAULT NULL COMMENT 'mysql',
  `factory_code` varchar(45) DEFAULT NULL COMMENT '区分租户',
  `redis_database` int DEFAULT NULL COMMENT 'redis数据库',
  `redis_url` varchar(128) DEFAULT NULL,
  `redis_pwd` varchar(45) DEFAULT NULL,
  `redis_port` int DEFAULT NULL,
  `mongo_url` varchar(128) DEFAULT NULL,
  `mongo_database` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3 COMMENT='数据源';

-- ----------------------------
-- Records of database_list
-- ----------------------------
BEGIN;
INSERT INTO `database_list` (`id`, `url`, `user`, `password`, `type`, `factory_code`, `redis_database`, `redis_url`, `redis_pwd`, `redis_port`, `mongo_url`, `mongo_database`) VALUES (1, 'jdbc:mysql://127.0.0.1:3306/gongdan?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true', 'root', '1234', 'mysql', 'GC001', 1, '127.0.0.1', '123456', 6379, 'mongodb://root:Aa123456@124.221.174.22:27017/testGC001', 'testGC001');
COMMIT;

-- ----------------------------
-- Table structure for departments
-- ----------------------------
DROP TABLE IF EXISTS `departments`;
CREATE TABLE `departments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(45) DEFAULT NULL COMMENT '部门编码',
  `name` varchar(45) DEFAULT NULL COMMENT '名称',
  `del_flag` int DEFAULT '0' COMMENT '是否删除  -1：已删除  0：正常',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `create_person` int DEFAULT NULL COMMENT '创建人',
  `ids` varchar(256) DEFAULT NULL COMMENT '部门人',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb3 COMMENT='部门表';

-- ----------------------------
-- Records of departments
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for device_info
-- ----------------------------
DROP TABLE IF EXISTS `device_info`;
CREATE TABLE `device_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `group_id` bigint DEFAULT NULL COMMENT '分组id(common_tree表id)',
  `mission_id` int DEFAULT NULL COMMENT '当前任务id',
  `device_sn` varchar(32) DEFAULT NULL COMMENT '设备编号',
  `real_device_sn` varchar(32) DEFAULT NULL COMMENT '设备序列号',
  `device_name` varchar(32) DEFAULT NULL COMMENT '设备名称',
  `device_pic` varchar(255) DEFAULT NULL COMMENT '设备图片',
  `bind_user` int DEFAULT NULL COMMENT '绑定人员(user表id)',
  `device_admin` int DEFAULT NULL COMMENT '设备管理员',
  `status` tinyint DEFAULT NULL COMMENT '状态(0 关机, 1 运行, 2 等待, 3 故障,4 离线)',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `enable_time` datetime DEFAULT NULL COMMENT '启用日期',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_user` int DEFAULT NULL COMMENT '更新人(user表id)',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `factory_id` int DEFAULT NULL,
  `csq` varchar(3) DEFAULT NULL COMMENT '信号强度',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_group_id` (`group_id`) USING BTREE COMMENT '分组(普通索引)',
  KEY `idx_bind_user` (`bind_user`) USING BTREE COMMENT '绑定人员id',
  KEY `idx_device_admin` (`device_admin`) USING BTREE COMMENT '设备管理员索引',
  KEY `idx_factory_id` (`factory_id`) USING BTREE COMMENT '工厂id普通索引',
  KEY `idx_mission_id` (`mission_id`) USING BTREE COMMENT '当前任务索引'
) ENGINE=InnoDB AUTO_INCREMENT=534 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备信息';

-- ----------------------------
-- Records of device_info
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for device_lamp_type
-- ----------------------------
DROP TABLE IF EXISTS `device_lamp_type`;
CREATE TABLE `device_lamp_type` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` bigint DEFAULT NULL COMMENT '设备id(device_info表id)',
  `lamp_type_id` bigint DEFAULT NULL COMMENT '安灯类型表id',
  `info_user` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '通知人员(user表id,多个以,号隔开)',
  `info_user_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '通知人员名称(多个以,号隔开)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_user` int DEFAULT NULL COMMENT '更新人(user表id)',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`),
  KEY `idx_device_id` (`device_id`) USING BTREE,
  KEY `idx_lamp_type_id` (`lamp_type_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='设备-安灯类型关联表';

-- ----------------------------
-- Records of device_lamp_type
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for device_produce_log
-- ----------------------------
DROP TABLE IF EXISTS `device_produce_log`;
CREATE TABLE `device_produce_log` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `device_id` bigint DEFAULT NULL COMMENT '设备id',
  `count` bigint DEFAULT NULL COMMENT '生产数量',
  `real_count` bigint DEFAULT NULL COMMENT '真实数量',
  `create_time` datetime DEFAULT NULL COMMENT '生产时间',
  `factory_id` int DEFAULT NULL,
  `time_interval` bigint DEFAULT NULL COMMENT '时间间隔',
  `mission_id` int DEFAULT NULL COMMENT '任务id',
  PRIMARY KEY (`id`),
  KEY `idx_device_id` (`device_id`) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE,
  KEY `idx_create_time` (`create_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=306 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='设备生产日志';

-- ----------------------------
-- Records of device_produce_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for device_status
-- ----------------------------
DROP TABLE IF EXISTS `device_status`;
CREATE TABLE `device_status` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` bigint DEFAULT NULL COMMENT '设备id',
  `status` tinyint DEFAULT NULL COMMENT '状态(0 关机, 1 运行, 2 等待, 3 故障,4 离线)',
  `duration` bigint DEFAULT NULL COMMENT '持续时间(秒)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `factory_id` int DEFAULT NULL,
  `report_exception` int DEFAULT '0' COMMENT '是否已上报异常(0 否,1 是 )',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_device_id` (`device_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=19908 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='设备状态记录';

-- ----------------------------
-- Records of device_status
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for device_use_log
-- ----------------------------
DROP TABLE IF EXISTS `device_use_log`;
CREATE TABLE `device_use_log` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `device_id` bigint DEFAULT NULL COMMENT '设备id',
  `user_id` int DEFAULT NULL COMMENT '用户id(usr表id)',
  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '截止时间',
  `factory_id` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE COMMENT '用户id(普通索引)',
  KEY `idx_device_id` (`device_id`) USING BTREE COMMENT '设备id(普通索引)',
  KEY `idx_factory_id` (`factory_id`) USING BTREE COMMENT '工厂id普通索引'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备使用记录表';

-- ----------------------------
-- Records of device_use_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for dict_event
-- ----------------------------
DROP TABLE IF EXISTS `dict_event`;
CREATE TABLE `dict_event` (
  `id` int NOT NULL AUTO_INCREMENT,
  `key_s` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `up` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `value_s` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `type` int DEFAULT NULL COMMENT '0/1/2\n工单/任务/报工',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='自定义事件字段字典';

-- ----------------------------
-- Records of dict_event
-- ----------------------------
BEGIN;
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (5, '${任务.工序编号}', NULL, 'processCode', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (6, '${任务.工序名称}', NULL, 'processName', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (7, '${任务.报工权限}', 'processes', 'permissions', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (8, '${任务.不良品列表}', 'processes', 'badProduct', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (9, '${任务.任务状态}', NULL, 'processState', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (10, '${任务.报工数配比}', NULL, 'rate', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (11, '${任务.计划数}', NULL, 'planedNumber', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (12, '${任务.良品数}', NULL, 'goodProductNumber', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (13, '${任务.不良品数}', NULL, 'badProductNumber', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (14, '${任务.计划开始时间}', NULL, 'startTime', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (15, '${任务.计划结束时间}', NULL, 'endTime', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (16, '${任务.实际开始时间}', NULL, 'actualStartTime', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (17, '${任务.实际结束时间}', NULL, 'actualEndTime', 1);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (22, '${报工.不良品原因}', NULL, NULL, 2);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (25, '${报工.报工时间}', NULL, 'reportStartTime', 2);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (26, '${报工.计价方式}', NULL, 'pricingMethod', 2);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (27, '${报工.报工工价}', 'wages', 'unitPrice', 2);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (28, '${报工.报工工资}', NULL, 'estimateWage', 2);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (29, '${报工.审批状态}', NULL, 'verifyState', 2);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (30, '${报工.审批人}', NULL, 'verifyUser', 2);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (39, '${产品.产品编号}', NULL, 'code', 3);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (40, '${产品.产品名称}', NULL, 'name', 3);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (41, '${产品.产品规格}', NULL, 'specification', 3);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (42, '${产品.单位}', NULL, 'unit', 3);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (43, '${产品.创建时间}', NULL, 'createTime', 3);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (44, '${产品.创建人}', NULL, 'createId', 3);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (45, '${产品.最后更新时间}', NULL, 'updateTime', 3);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (46, '${用户信息.账号}', NULL, 'account', 4);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (47, '${用户信息.姓名}', NULL, 'name', 4);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (48, '${用户信息.手机号}', NULL, 'mobile', 4);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (49, '${用户信息.角色}', NULL, 'role', 4);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (50, '${工序.工序编号}', NULL, 'code', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (51, '${工序.工序名称}', NULL, 'name', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (52, '${工序.报工数配比}', NULL, 'rate', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (53, '${工序.计划数}', NULL, 'planedNumber', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (54, '${工序.良品数}', NULL, 'goodProductNumber', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (55, '${工序.不良品数}', NULL, 'badProductNumber', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (56, '${工序.计划开始时间}', NULL, 'startTime', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (57, '${工序.计划结束时间}', NULL, 'endTime', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (58, '${工序.实际开始时间}', NULL, 'actualStartTime', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (59, '${工序.实际结束时间}', NULL, 'actualEndTime', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (60, '${工序.产品名称}', 'product', 'name', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (61, '${工序.产品编号}', 'product', 'code', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (62, '${工序.产品规格}', 'product', 'specification', 5);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (63, '${工单.工单编号}', NULL, 'code', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (64, '${工单.产品编号}', NULL, 'productCode', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (65, '${工单.产品名称}', NULL, 'productName', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (66, '${工单.产品规格}', NULL, 'productSpecification', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (67, '${工单.工单状态}', NULL, 'state', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (68, '${工单.计划开始时间}', NULL, 'startTime', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (69, '${工单.计划结束时间}', NULL, 'endTime', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (70, '${工单.计划数}', NULL, 'planedNumber', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (71, '${工单.良品数}', NULL, 'goodProductNumber', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (72, '${工单.不良品数}', NULL, 'badProductNumber', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (73, '${工单.实际开始时间}', NULL, 'actualStartTime', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (74, '${工单.实际结束时间}', NULL, 'actualEndTime', 0);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (75, '${报工.工单编号}', 'mission', 'workOrderCode', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (76, '${报工.工序名称}', 'mission', 'processName', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (77, '${报工.报工数}', NULL, 'reportNumber', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (78, '${报工.良品数}', NULL, 'goodProductNumber', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (79, '${报工.不良品数}', NULL, 'badProductNumber', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (80, '${报工.生产人员}', NULL, 'produceUser', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (81, '${报工.开始时间}', NULL, 'reportStartTime', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (82, '${报工.结束时间}', NULL, 'reportEndTime', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (83, '${报工.产品编号}', 'product', 'code', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (84, '${报工.产品名称}', 'product', 'name', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (85, '${报工.产品规格}', 'product', 'specification', 6);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (86, '${出入库单.出/入库单号}', NULL, 'code', 7);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (87, '${出入库单.出/入库类型}', NULL, 'typeOther', 7);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (88, '${出入库单.出/入库时间}', NULL, 'createTime', 7);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (89, '${出入库单.备注}', NULL, 'comment', 7);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (90, '${出入库明细.出/入库数量}', NULL, 'handleNum', 8);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (91, '${报工.任务.良品数}', 'mission', 'goodProductNumber', 99);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (92, '${报工.任务.不良品数}', 'mission', 'badProductNumber', 99);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (93, '${报工.任务.计划数}', 'mission', 'planedNumber', 99);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (94, '${报工.任务.上一道任务.良品数}', 'backMission', 'goodProductNumber', 99);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (95, '${报工.任务.上一道任务.不良品数}', 'mission', 'badProductNumber', 99);
INSERT INTO `dict_event` (`id`, `key_s`, `up`, `value_s`, `type`) VALUES (96, '${报工.任务.上一道任务.计划数}', 'mission', 'planedNumber', 99);
COMMIT;

-- ----------------------------
-- Table structure for dimension_combination
-- ----------------------------
DROP TABLE IF EXISTS `dimension_combination`;
CREATE TABLE `dimension_combination` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '绩效工资维度组合',
  `combination` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '组合',
  `level` int DEFAULT NULL COMMENT '优先级',
  `state` int DEFAULT NULL COMMENT '0/1  未生效/已生效',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='绩效工资维度组合';

-- ----------------------------
-- Records of dimension_combination
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for event_log
-- ----------------------------
DROP TABLE IF EXISTS `event_log`;
CREATE TABLE `event_log` (
  `id` int NOT NULL AUTO_INCREMENT,
  `event_id` int DEFAULT NULL,
  `time` timestamp NULL DEFAULT NULL,
  `state` int DEFAULT NULL COMMENT '0/1 成功/失败',
  `msg` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='自定义事件执行日志';

-- ----------------------------
-- Records of event_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for exception_info
-- ----------------------------
DROP TABLE IF EXISTS `exception_info`;
CREATE TABLE `exception_info` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `device_id` bigint DEFAULT NULL COMMENT '设备id(device表id)',
  `group_id` bigint DEFAULT NULL COMMENT '分组(common_tree表id)',
  `exception_type` bigint DEFAULT NULL COMMENT '异常类型(exception_type_id)',
  `mission_id` int DEFAULT NULL COMMENT '任务id(mission表id)',
  `lamp_color` tinyint DEFAULT NULL COMMENT '指示灯颜色(0 黄色,1 红色)',
  `exception_reason` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '异常原因',
  `end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_user` int DEFAULT NULL COMMENT '更新人',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_devcice_id` (`device_id`) USING BTREE,
  KEY `idx_exception_type` (`exception_type`) USING BTREE,
  KEY `idx_mission_id` (`mission_id`) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6228 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='异常信息';

-- ----------------------------
-- Records of exception_info
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for exception_notice
-- ----------------------------
DROP TABLE IF EXISTS `exception_notice`;
CREATE TABLE `exception_notice` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `lamp_color` tinyint DEFAULT NULL COMMENT '指示灯颜色(0 黄色,1 红色)',
  `group_id` bigint DEFAULT NULL COMMENT '分组(common_tree表id)',
  `delay_time` int DEFAULT NULL COMMENT '延时时长(分钟)',
  `info_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '通知方式(0 微信,1 邮箱, 2 AI语音)',
  `info_user_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '通知人员id(多个以,号隔开)',
  `info_user_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '通知人员名称(多个以,号隔开)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `create_user` int DEFAULT NULL COMMENT '创建人',
  `update_user` int DEFAULT NULL COMMENT '修改人',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_create_user` (`create_user`) USING BTREE,
  KEY `idx_update_user` (`update_user`) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='异常通知信息';

-- ----------------------------
-- Records of exception_notice
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for exception_type
-- ----------------------------
DROP TABLE IF EXISTS `exception_type`;
CREATE TABLE `exception_type` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `lamp_color` tinyint DEFAULT NULL COMMENT '指示灯颜色(0 黄色,1 红色)',
  `exception_reason` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '异常原因',
  `type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '分类',
  `group_id` bigint DEFAULT NULL COMMENT '分组(common_tree表id)',
  `lamp_type` bigint DEFAULT NULL COMMENT '安灯请求(lamp_type表id)',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_user` int DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`),
  KEY `idx_group_id` (`group_id`) USING BTREE,
  KEY `idx_lamp_type` (`lamp_type`) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='异常信息';

-- ----------------------------
-- Records of exception_type
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for factory
-- ----------------------------
DROP TABLE IF EXISTS `factory`;
CREATE TABLE `factory` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '编号',
  `name` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '名称',
  `end_time` datetime DEFAULT NULL,
  `cloud` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `product` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '产品',
  `address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '地址',
  `contacts` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '联系人',
  `contacts_phone` char(11) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '联系电话',
  `create_time` timestamp NULL DEFAULT NULL,
  `logo_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '工厂logo',
  `real_factory_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '授权工厂名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

-- ----------------------------
-- Records of factory
-- ----------------------------
BEGIN;
INSERT INTO `factory` (`id`, `code`, `name`, `end_time`, `cloud`, `product`, `address`, `contacts`, `contacts_phone`, `create_time`, `logo_url`, `real_factory_name`) VALUES (1, 'GC001', '测试工厂1', '2099-04-03 17:31:00', '默认', '', '合肥市深港产业园10栋201室', '', '', '2022-04-03 09:31:46', NULL, '');
COMMIT;

-- ----------------------------
-- Table structure for form_check_rule
-- ----------------------------
DROP TABLE IF EXISTS `form_check_rule`;
CREATE TABLE `form_check_rule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `check_rule` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT '校验规则',
  `err_msg` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '错误提示',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='报工表单校验规则';

-- ----------------------------
-- Records of form_check_rule
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for form_table
-- ----------------------------
DROP TABLE IF EXISTS `form_table`;
CREATE TABLE `form_table` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  `create_user` int DEFAULT NULL COMMENT '创建人',
  `update_user` int DEFAULT NULL COMMENT '修改人',
  `type` int DEFAULT NULL COMMENT '类型 0/1/2 销售订单/生产计划/装配工单',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

-- ----------------------------
-- Records of form_table
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for form_table_detail
-- ----------------------------
DROP TABLE IF EXISTS `form_table_detail`;
CREATE TABLE `form_table_detail` (
  `id` int NOT NULL AUTO_INCREMENT,
  `form_table_code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `product_id` int DEFAULT NULL,
  `work_order_code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `handle_number` decimal(20,6) DEFAULT NULL COMMENT '操作数量',
  `level_code` decimal(10,6) DEFAULT NULL COMMENT '层级编号',
  `unit_use` decimal(10,6) DEFAULT NULL COMMENT '单位用量',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=78 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

-- ----------------------------
-- Records of form_table_detail
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for handle_log
-- ----------------------------
DROP TABLE IF EXISTS `handle_log`;
CREATE TABLE `handle_log` (
  `id` int NOT NULL AUTO_INCREMENT,
  `handle_id` int DEFAULT NULL COMMENT '操作人',
  `handle_type` varchar(45) DEFAULT NULL COMMENT '操作类型',
  `handle_detail` text COMMENT '操作详情',
  `handle_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `type` varchar(45) DEFAULT NULL,
  `handle_code` varchar(45) DEFAULT NULL,
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2005 DEFAULT CHARSET=utf8mb3 COMMENT='操作日志';

-- ----------------------------
-- Records of handle_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for lamp_box
-- ----------------------------
DROP TABLE IF EXISTS `lamp_box`;
CREATE TABLE `lamp_box` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `button_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '按钮名称',
  `color` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '颜色',
  `lamp_type_id` bigint DEFAULT NULL COMMENT '安灯类型id(lamp_type表id)',
  `group_id` bigint DEFAULT NULL COMMENT '分组ID(common_tree表id)',
  `update_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_user` int DEFAULT NULL COMMENT '创建人',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`),
  KEY `idx_lamp_type_id` (`lamp_type_id`) USING BTREE,
  KEY `idx_group_id` (`group_id`) USING BTREE,
  KEY `idx_factory_id` (`factory_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=333 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

-- ----------------------------
-- Records of lamp_box
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for lamp_request
-- ----------------------------
DROP TABLE IF EXISTS `lamp_request`;
CREATE TABLE `lamp_request` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '安灯请求id',
  `type` bigint DEFAULT NULL COMMENT '安灯类型(lamp_type表id)',
  `device_id` bigint DEFAULT NULL COMMENT '设备id',
  `deal_state` tinyint DEFAULT NULL COMMENT '处理状态(0 等待响应, 1 请求中, 2 已关闭)',
  `deal_user` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '处理人(多个以,号隔开)',
  `deal_user_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '处理人员名称(多个以,号隔开)',
  `response_time` datetime DEFAULT NULL COMMENT '响应时间',
  `response_user` int DEFAULT NULL COMMENT '响应处理人(user表id)',
  `create_user` int DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `update_user` int DEFAULT NULL COMMENT '更新人(user表id)',
  `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '备注',
  `note` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '补充说明',
  `note_img` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '补充说明图片',
  `result` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '处理结果备注',
  `result_img` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '处理结果图片',
  `finish_time` datetime DEFAULT NULL COMMENT '处理完成时间',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_type` (`type`) USING BTREE COMMENT '请求类型(普通索引)',
  KEY `idx_create_user` (`create_user`) USING BTREE COMMENT '创建人(普通索引)',
  KEY `idx_deal_user` (`deal_user`) USING BTREE COMMENT '处理人(普通索引)'
) ENGINE=InnoDB AUTO_INCREMENT=604 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='安灯请求';

-- ----------------------------
-- Records of lamp_request
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for lamp_request_detail
-- ----------------------------
DROP TABLE IF EXISTS `lamp_request_detail`;
CREATE TABLE `lamp_request_detail` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `lamp_request_id` bigint DEFAULT NULL COMMENT '安灯请求表id(lamp_request表id)',
  `content` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '消息内容',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_user` int DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_lamp_request_id` (`lamp_request_id`) USING BTREE COMMENT '安灯请求(普通索引)',
  KEY `idx_create_user` (`create_user`) USING BTREE COMMENT '创建人(普通索引)'
) ENGINE=InnoDB AUTO_INCREMENT=711 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='安灯请求详情表';

-- ----------------------------
-- Records of lamp_request_detail
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for lamp_request_notice
-- ----------------------------
DROP TABLE IF EXISTS `lamp_request_notice`;
CREATE TABLE `lamp_request_notice` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `lamp_request_id` bigint DEFAULT NULL COMMENT '安灯请求id（lamp_request表id）',
  `user_id` int DEFAULT NULL COMMENT '通知人id',
  `notice_time` datetime DEFAULT NULL COMMENT '通知时间',
  `notice_text` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '通知内容',
  `info_type` int DEFAULT NULL COMMENT '通知方式(0 微信, 1 ai语音,3 微信和语音)',
  `info_status` int DEFAULT NULL COMMENT '0 未通知，1 已微信通知,2 已ai语音通知, 3 已微信,ai语音通知',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  `round_num` int DEFAULT '1' COMMENT '轮数',
  `interval_time` int DEFAULT '3' COMMENT '间隔时间(分钟)',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_lamp_request_id` (`lamp_request_id`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE,
  KEY `idx_info_type` (`info_type`) USING BTREE,
  KEY `idx_notice_time` (`notice_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1172 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='安灯请求通知关联表';

-- ----------------------------
-- Records of lamp_request_notice
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for lamp_type
-- ----------------------------
DROP TABLE IF EXISTS `lamp_type`;
CREATE TABLE `lamp_type` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '安灯类型',
  `group_id` bigint DEFAULT NULL COMMENT '所属分组(common_tree表belong_module = 0 的结构)',
  `color` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '颜色',
  `name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '名称',
  `sort` int DEFAULT NULL COMMENT '序号',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user` int DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_user` int DEFAULT NULL COMMENT '创建人',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_group_id` (`group_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='安灯类型';

-- ----------------------------
-- Records of lamp_type
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for lamp_type_notice
-- ----------------------------
DROP TABLE IF EXISTS `lamp_type_notice`;
CREATE TABLE `lamp_type_notice` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id分级',
  `lamp_type_id` bigint DEFAULT NULL COMMENT '安灯类型id(lamp_type表id)',
  `delay_time` int DEFAULT NULL COMMENT '延时时长(分钟)',
  `info_type` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '通知方式(0 微信, 1 ai语音,多个以,号隔开)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  `round_num` int DEFAULT NULL COMMENT '轮数',
  `Interval_time` int DEFAULT NULL COMMENT '间隔时间(分钟)',
  PRIMARY KEY (`id`),
  KEY `idx_lamp_type_id` (`lamp_type_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='安灯分级通知表';

-- ----------------------------
-- Records of lamp_type_notice
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for lamp_type_user
-- ----------------------------
DROP TABLE IF EXISTS `lamp_type_user`;
CREATE TABLE `lamp_type_user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `lamp_type_id` bigint DEFAULT NULL COMMENT '安灯类型id(lamp_type_id)',
  `lamp_type_notice_id` bigint DEFAULT NULL COMMENT '安灯通知id(lamp_type_notice表id)',
  `user_id` int DEFAULT NULL COMMENT '用户id(user表id)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE,
  KEY `idx_lamp_type_notice_id` (`lamp_type_notice_id`) USING BTREE,
  KEY `idx_lamp_type_id` (`lamp_type_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=210 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='安灯类用户关联表';

-- ----------------------------
-- Records of lamp_type_user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for matching_rule
-- ----------------------------
DROP TABLE IF EXISTS `matching_rule`;
CREATE TABLE `matching_rule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `business_object` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '业务对象(字段归属)',
  `attribute` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '属性',
  `cus_field` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `state` int DEFAULT NULL COMMENT '0/1 未生效/已生效',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=82 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='绩效工资取数维度';

-- ----------------------------
-- Records of matching_rule
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mission
-- ----------------------------
DROP TABLE IF EXISTS `mission`;
CREATE TABLE `mission` (
  `id` int NOT NULL AUTO_INCREMENT,
  `work_order_code` varchar(45) DEFAULT NULL COMMENT '工单编号',
  `product_code` varchar(45) DEFAULT NULL COMMENT '产品编号',
  `process_code` varchar(45) DEFAULT NULL COMMENT '工序编号',
  `planed_number` decimal(16,6) DEFAULT NULL COMMENT '计划数',
  `good_product_number` decimal(16,6) DEFAULT '0.000000' COMMENT '良品数',
  `bad_product_number` decimal(16,6) DEFAULT '0.000000' COMMENT '不良品数',
  `process_state` int DEFAULT NULL COMMENT '0/1/2  未开始/执行中/已结束',
  `actual_start_time` timestamp NULL DEFAULT NULL COMMENT '实际开始',
  `actual_end_time` timestamp NULL DEFAULT NULL COMMENT '实际结束',
  `last` int DEFAULT NULL COMMENT '工序顺序',
  `start_time` timestamp NULL DEFAULT NULL COMMENT '计划开始',
  `end_time` timestamp NULL DEFAULT NULL COMMENT '计划结束',
  `distribution_list` varchar(128) DEFAULT NULL COMMENT '分配列表',
  `rate` decimal(20,6) DEFAULT NULL COMMENT '报工数配比',
  `process_collection_data` text COMMENT '工序采集数据',
  `process_other` text,
  `is_urgent` int DEFAULT NULL COMMENT '是否加急（0不加急  1加急）',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `search` (`work_order_code`,`product_code`,`process_code`),
  KEY `workOderCode` (`work_order_code`),
  KEY `productCode` (`product_code`),
  KEY `processCode` (`process_code`)
) ENGINE=InnoDB AUTO_INCREMENT=2510 DEFAULT CHARSET=utf8mb3 COMMENT='任务';

-- ----------------------------
-- Records of mission
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mobile_card_conf
-- ----------------------------
DROP TABLE IF EXISTS `mobile_card_conf`;
CREATE TABLE `mobile_card_conf` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `cn_name` varchar(50) DEFAULT NULL COMMENT '中文名称',
  `en_name` varchar(20) DEFAULT NULL COMMENT '英文名称',
  `sort` int DEFAULT NULL COMMENT '排序',
  `belong_module` int DEFAULT NULL COMMENT '所属模块(0 工单)',
  `type` tinyint unsigned DEFAULT NULL COMMENT '类型(0 标题, 1 封面, 2 元素)',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `column_module` varchar(15) DEFAULT NULL COMMENT '字段所属模块',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=303 DEFAULT CHARSET=utf8mb3 COMMENT='移动端卡片设置';

-- ----------------------------
-- Records of mobile_card_conf
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for num
-- ----------------------------
DROP TABLE IF EXISTS `num`;
CREATE TABLE `num` (
  `i` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of num
-- ----------------------------
BEGIN;
INSERT INTO `num` (`i`) VALUES (0);
INSERT INTO `num` (`i`) VALUES (1);
INSERT INTO `num` (`i`) VALUES (2);
INSERT INTO `num` (`i`) VALUES (3);
INSERT INTO `num` (`i`) VALUES (4);
INSERT INTO `num` (`i`) VALUES (5);
INSERT INTO `num` (`i`) VALUES (6);
INSERT INTO `num` (`i`) VALUES (7);
INSERT INTO `num` (`i`) VALUES (8);
INSERT INTO `num` (`i`) VALUES (9);
COMMIT;

-- ----------------------------
-- Table structure for print_template
-- ----------------------------
DROP TABLE IF EXISTS `print_template`;
CREATE TABLE `print_template` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `template_name` varchar(50) DEFAULT NULL COMMENT '模板名称',
  `belong_module` int DEFAULT NULL COMMENT '所属模块(0 工单模块 1 入库单模板  2出库单模板 3 装配工单)',
  `template_type` int DEFAULT NULL COMMENT '模板类型(0 系统模板,1 公共模板)',
  `template_path` varchar(255) DEFAULT NULL COMMENT '模板路径',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user` bigint DEFAULT NULL COMMENT '创建人(user表 id)',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=103 DEFAULT CHARSET=utf8mb3 COMMENT='打印模板表';

-- ----------------------------
-- Records of print_template
-- ----------------------------
BEGIN;
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (73, '工单二维码.xlsx', 0, 0, '/service/file/printTemplate/工单二维码.xlsx', '2022-08-17 14:16:42', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (74, '工单列表.xlsx', 0, 0, '/service/file/printTemplate/工单列表.xlsx', '2022-08-17 14:16:50', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (75, '工单流转卡.xlsx', 0, 0, '/service/file/printTemplate/工单流转卡.xlsx', '2022-08-17 14:16:55', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (76, '入库单列表.xlsx', 1, 0, '/service/file/printTemplate/入库单列表.xlsx', '2022-08-17 14:17:04', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (77, '入库单明细.xlsx', 1, 0, '/service/file/printTemplate/入库单明细.xlsx', '2022-08-17 14:17:10', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (78, '出库单列表.xlsx', 2, 0, '/service/file/printTemplate/出库单列表.xlsx', '2022-08-17 14:17:24', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (79, '出库单明细.xlsx', 2, 0, '/service/file/printTemplate/出库单明细.xlsx', '2022-08-17 14:17:29', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (80, '工单流转卡.xlsx', 0, 0, '/service/file/printTemplate/工单流转卡.xlsx', '2022-08-16 03:53:45', 1, 5);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (89, '装配工单明细.xlsx', 3, 0, '/service/file/printTemplate/装配工单明细.xlsx', '2023-04-04 16:09:10', 1, 5);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (90, '装配工单明细.xlsx', 3, 0, '/service/file/printTemplate/装配工单明细.xlsx', '2023-04-04 16:09:10', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (91, '计数报表20230922135020-1695362002318.xls', 3, 1, '/service/file/printTemplate/2023-09-22/计数报表20230922135020-1695362002318.xls', '2023-09-22 13:53:22', 1, 1);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (92, '工单二维码.xlsx', 0, 0, '/service/file/printTemplate/工单二维码.xlsx', '2022-08-17 14:16:42', 1, 2);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (93, '工单列表.xlsx', 0, 0, '/service/file/printTemplate/工单列表.xlsx', '2022-08-17 14:16:50', 1, 2);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (94, '工单流转卡.xlsx', 0, 0, '/service/file/printTemplate/工单流转卡.xlsx', '2022-08-17 14:16:55', 1, 2);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (95, '入库单列表.xlsx', 1, 0, '/service/file/printTemplate/入库单列表.xlsx', '2022-08-17 14:17:04', 1, 2);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (96, '入库单明细.xlsx', 1, 0, '/service/file/printTemplate/入库单明细.xlsx', '2022-08-17 14:17:10', 1, 2);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (97, '出库单列表.xlsx', 2, 0, '/service/file/printTemplate/出库单列表.xlsx', '2022-08-17 14:17:24', 1, 2);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (98, '出库单明细.xlsx', 2, 0, '/service/file/printTemplate/出库单明细.xlsx', '2022-08-17 14:17:29', 1, 2);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (99, '装配工单明细.xlsx', 3, 0, '/service/file/printTemplate/装配工单明细.xlsx', '2023-04-04 16:09:10', 1, 2);
INSERT INTO `print_template` (`id`, `template_name`, `belong_module`, `template_type`, `template_path`, `create_time`, `create_user`, `factory_id`) VALUES (102, '物料清单20230922140055-1695623334483.xlsx', 3, 1, '/service/file/printTemplate/2023-09-25/物料清单20230922140055-1695623334483.xlsx', '2023-09-25 14:28:54', 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for process_route
-- ----------------------------
DROP TABLE IF EXISTS `process_route`;
CREATE TABLE `process_route` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(45) DEFAULT NULL COMMENT '编号',
  `name` varchar(45) DEFAULT NULL COMMENT '名称',
  `process_list` text COMMENT '工序列表',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb3 COMMENT='工艺路线';

-- ----------------------------
-- Records of process_route
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for process_sop
-- ----------------------------
DROP TABLE IF EXISTS `process_sop`;
CREATE TABLE `process_sop` (
  `id` int NOT NULL AUTO_INCREMENT,
  `process_name` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '工序名称',
  `process_code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '工序名称',
  `state` tinyint(1) DEFAULT '1' COMMENT '状态 0/1 启用/停用',
  `begin_zone` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '开始分区',
  `zone_detail` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT '分区详情',
  `end_zone` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '结束分区',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='sop模版';

-- ----------------------------
-- Records of process_sop
-- ----------------------------
BEGIN;
INSERT INTO `process_sop` (`id`, `process_name`, `process_code`, `state`, `begin_zone`, `zone_detail`, `end_zone`, `factory_id`) VALUES (1, '********', '********', 0, NULL, '[{\"name\":\"任务状态\",\"down\":[{\"name\":\"任务状态\"}]},{\"name\":\"产出列表\",\"down\":[{\"name\":\"报工产出\"}]},{\"name\":\"工序报表\",\"down\":[{\"name\":\"全部工序采集数据\"}]}]', NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for processes
-- ----------------------------
DROP TABLE IF EXISTS `processes`;
CREATE TABLE `processes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(45) DEFAULT NULL,
  `name` varchar(45) DEFAULT NULL,
  `permissions` varchar(200) DEFAULT NULL COMMENT '报工权限\n',
  `permissions_dep` varchar(45) DEFAULT NULL,
  `permissions_name` varchar(1024) DEFAULT NULL,
  `bad_product` varchar(45) DEFAULT NULL COMMENT '不良品ids',
  `other` text COMMENT '预留字段',
  `rate` decimal(10,6) DEFAULT NULL COMMENT '报工数配比',
  `collection_data` text COMMENT '工序采集数据',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  `pricing_method` int DEFAULT NULL COMMENT '0/1 计件/计时',
  `qr` varchar(128) DEFAULT NULL COMMENT '二维码',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `code` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb3 COMMENT='工序';

-- ----------------------------
-- Records of processes
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for product
-- ----------------------------
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(45) DEFAULT NULL,
  `name` varchar(45) DEFAULT NULL,
  `unit_id` int DEFAULT NULL COMMENT '单位id',
  `unit_price` decimal(10,2) DEFAULT '0.00' COMMENT '产品单价',
  `specification` varchar(45) DEFAULT NULL COMMENT '规格',
  `process_route_id` int DEFAULT NULL COMMENT '工艺路线id',
  `stock` decimal(16,6) DEFAULT '0.000000' COMMENT '库存数量',
  `create_id` int DEFAULT NULL COMMENT '创建人',
  `del_flag` int DEFAULT '0' COMMENT '0/1 正常/删除',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `other` text,
  `minimum` decimal(16,6) DEFAULT NULL,
  `maximum` decimal(16,6) DEFAULT NULL,
  `safe` decimal(16,6) DEFAULT NULL,
  `now_num` decimal(16,6) DEFAULT NULL,
  `attribute` tinyint DEFAULT '0' COMMENT '0/1/2(自制/外购/委外)\n自制/外购',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  `qr` varchar(128) DEFAULT NULL COMMENT '二维码',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `search` (`code`,`name`,`unit_id`,`specification`),
  KEY `code` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8mb3 COMMENT='产品';

-- ----------------------------
-- Records of product
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for report_bad_product
-- ----------------------------
DROP TABLE IF EXISTS `report_bad_product`;
CREATE TABLE `report_bad_product` (
  `id` int NOT NULL AUTO_INCREMENT,
  `bad_product_id` int DEFAULT NULL,
  `num` decimal(11,2) DEFAULT NULL,
  `work_report_id` int DEFAULT NULL,
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of report_bad_product
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for screen_plan
-- ----------------------------
DROP TABLE IF EXISTS `screen_plan`;
CREATE TABLE `screen_plan` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '名称',
  `type` int DEFAULT NULL COMMENT '0/1\n工单/任务',
  `user_id` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '使用范围 用户ids',
  `dep_id` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `user_id_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `second_group` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '二级分组\ntype为1任务时表示0/1/2/3 工序名称/工序状态/分配状态/分配列表',
  `screen_condition` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT '筛选条件json',
  `create_user` int DEFAULT NULL COMMENT '创建人(user表id)',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='筛选方案';

-- ----------------------------
-- Records of screen_plan
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for stock_detail
-- ----------------------------
DROP TABLE IF EXISTS `stock_detail`;
CREATE TABLE `stock_detail` (
  `id` int NOT NULL AUTO_INCREMENT,
  `product_id` int DEFAULT NULL,
  `handle_num` decimal(16,6) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT NULL,
  `create_id` int DEFAULT NULL,
  `sm_id` int DEFAULT NULL,
  `other` text,
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=239 DEFAULT CHARSET=utf8mb3 COMMENT='库存明细';

-- ----------------------------
-- Records of stock_detail
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for stock_msg
-- ----------------------------
DROP TABLE IF EXISTS `stock_msg`;
CREATE TABLE `stock_msg` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL COMMENT '0/1/3 入库/出库/报工入库',
  `time` timestamp NULL DEFAULT NULL COMMENT '操作时间',
  `type_other` varchar(45) DEFAULT NULL COMMENT '出入库细分类型',
  `code` varchar(45) DEFAULT NULL COMMENT '单号',
  `comment` varchar(45) DEFAULT NULL COMMENT '备注',
  `create_id` int DEFAULT NULL COMMENT '创建人',
  `create_time` timestamp NULL DEFAULT NULL,
  `update_time` timestamp NULL DEFAULT NULL,
  `other` text,
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=180 DEFAULT CHARSET=utf8mb3 COMMENT='库存记录';

-- ----------------------------
-- Records of stock_msg
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL COMMENT '菜单名称',
  `parent_id` int DEFAULT NULL COMMENT '父菜单ID，一级菜单为0',
  `url` varchar(200) DEFAULT NULL COMMENT '菜单URL,类型：1.普通页面（如用户管理， /sys/user） 2.嵌套完整外部页面，以http(s)开头的链接 3.嵌套服务器页面，使用iframe:前缀+目标URL(如SQL监控， iframe:/druid/login.html, iframe:前缀会替换成服务器地址)',
  `type` int DEFAULT NULL COMMENT '资源类型（1:菜单，2:按钮）',
  `level` int DEFAULT NULL COMMENT '菜单层级 1/2/3',
  `menu_type` int DEFAULT NULL COMMENT 'web/移动端 0/1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='菜单';

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_calendar_auxiliary
-- ----------------------------
DROP TABLE IF EXISTS `t_calendar_auxiliary`;
CREATE TABLE `t_calendar_auxiliary` (
  `i` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='日历辅助表';

-- ----------------------------
-- Records of t_calendar_auxiliary
-- ----------------------------
BEGIN;
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (0);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (1);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (2);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (3);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (4);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (5);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (6);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (7);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (8);
INSERT INTO `t_calendar_auxiliary` (`i`) VALUES (9);
COMMIT;

-- ----------------------------
-- Table structure for unit
-- ----------------------------
DROP TABLE IF EXISTS `unit`;
CREATE TABLE `unit` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `comment` varchar(45) DEFAULT NULL COMMENT '备注',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb3 COMMENT='单位';

-- ----------------------------
-- Records of unit
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL COMMENT '姓名',
  `account` varchar(45) DEFAULT NULL COMMENT '账号',
  `password` varchar(128) DEFAULT NULL COMMENT '密码',
  `mobile` varchar(45) DEFAULT NULL COMMENT '手机号',
  `openid` varchar(45) DEFAULT NULL,
  `role` varchar(45) DEFAULT NULL COMMENT '角色( 2 生产人员)',
  `dep_id` varchar(45) DEFAULT NULL COMMENT '部门id',
  `state` int NOT NULL DEFAULT '0' COMMENT '0/1 正常/停用',
  `virtual_type` int NOT NULL DEFAULT '0' COMMENT '是否虚拟用户 0/1 不是/是',
  `create_time` timestamp NULL DEFAULT NULL,
  `update_time` timestamp NULL DEFAULT NULL,
  `h5_menu_id` varchar(200) DEFAULT NULL COMMENT 'h5菜单id',
  `web_menu_id` varchar(200) DEFAULT NULL COMMENT '后台web',
  `factory_id` int DEFAULT NULL,
  `other` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8mb3 COMMENT='用户表';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`id`, `name`, `account`, `password`, `mobile`, `openid`, `role`, `dep_id`, `state`, `virtual_type`, `create_time`, `update_time`, `h5_menu_id`, `web_menu_id`, `factory_id`, `other`) VALUES (1, 'fff', 'admin', '66c37031970857024e99549748b279627f67c0931a16fe0b', '15555140863', '', '1,2,0', '', 0, 0, '2022-04-29 17:39:21', '2023-05-04 19:37:25', NULL, NULL, 1, '');
COMMIT;

-- ----------------------------
-- Table structure for user_menu
-- ----------------------------
DROP TABLE IF EXISTS `user_menu`;
CREATE TABLE `user_menu` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `menu` text,
  `type` int DEFAULT '0' COMMENT '0/1 web/h5',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb3 COMMENT='用户菜单权限';

-- ----------------------------
-- Records of user_menu
-- ----------------------------
BEGIN;
INSERT INTO `user_menu` (`id`, `user_id`, `menu`, `type`) VALUES (1, 0, '[{\"blPerm\":true,\"permCode\":\"home.page\",\"permTitle\":\"主页\",\"iconName\":\"icon-shouye\",\"index\":\"/home\",\"submenu\":[]},{\"blPerm\":true,\"permCode\":\"production.management\",\"permTitle\":\"生产管理\",\"iconName\":\"icon-shengchanguanli\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"assembleOrder\",\"permTitle\":\"装配工单\",\"index\":\"/productionManagement/assembleOrder\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"assembleOrder.edit\"},{\"blPerm\":true,\"permCode\":\"assembleOrder.create\"},{\"blPerm\":true,\"permCode\":\"assembleOrder.copy\"}]},{\"blPerm\":true,\"permCode\":\"salesOrder\",\"permTitle\":\"销售订单\",\"index\":\"/productionManagement/salesOrder\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"salesOrder.create\"},{\"blPerm\":true,\"permCode\":\"salesOrder.edit\"},{\"blPerm\":true,\"permCode\":\"salesOrder.copy\"}]},{\"blPerm\":true,\"chooseSchemeChecked\":true,\"filtrateConfig\":[{\"blPerm\":true,\"permCode\":\"button.createOrder\",\"permTitle\":\"创建工单\"},{\"blPerm\":true,\"permCode\":\"button.batchStart\",\"permTitle\":\"批量开始\"},{\"blPerm\":true,\"permCode\":\"button.batchRecall\",\"permTitle\":\"批量撤回\"},{\"blPerm\":true,\"permCode\":\"button.batchDelete\",\"permTitle\":\"批量删除\"},{\"blPerm\":true,\"permCode\":\"button.batchEnd\",\"permTitle\":\"批量结束\"},{\"blPerm\":true,\"permCode\":\"button.batchCancel\",\"permTitle\":\"批量取消\"},{\"blPerm\":true,\"permCode\":\"button.batchPrint\",\"permTitle\":\"批量打印\"},{\"blPerm\":true,\"permCode\":\"button.export\",\"permTitle\":\"导出\"},{\"blPerm\":true,\"permCode\":\"button.import\",\"permTitle\":\"导入\"},{\"blPerm\":true,\"permCode\":\"button.editPrintMould\",\"permTitle\":\"编辑打印模板\"},{\"blPerm\":true,\"permCode\":\"button.cardSet\",\"permTitle\":\"移动端卡片设置\"},{\"blPerm\":true,\"permCode\":\"button.columnConfig\",\"permTitle\":\"列配置\"},{\"blPerm\":true,\"permCode\":\"button.edit\",\"permTitle\":\"编辑\"},{\"blPerm\":true,\"permCode\":\"button.start\",\"permTitle\":\"开始\"},{\"blPerm\":true,\"permCode\":\"button.recall\",\"permTitle\":\"撤回\"},{\"blPerm\":true,\"permCode\":\"button.end\",\"permTitle\":\"结束\"},{\"blPerm\":true,\"permCode\":\"button.cancel\",\"permTitle\":\"取消\"},{\"blPerm\":true,\"permCode\":\"button.print\",\"permTitle\":\"打印\"},{\"blPerm\":true,\"permCode\":\"button.copy\",\"permTitle\":\"复制\"},{\"blPerm\":true,\"permCode\":\"button.delete\",\"permTitle\":\"删除\"}],\"permCode\":\"project\",\"permTitle\":\"工单\",\"index\":\"/productionManagement/workOrder\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"project.create\"},{\"blPerm\":true,\"permCode\":\"project.loadlog\"},{\"blPerm\":true,\"permCode\":\"project.custom\"},{\"blPerm\":true,\"permCode\":\"project.detail\"},{\"blPerm\":true,\"permCode\":\"project.record\"},{\"blPerm\":true,\"permCode\":\"project.copy\"},{\"blPerm\":true,\"permCode\":\"project.logDetails\"}]},{\"blPerm\":true,\"permCode\":\"project.task\",\"permTitle\":\"任务\",\"index\":\"/productionManagement/task\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"task.custom\"},{\"blPerm\":true,\"permCode\":\"task.edit\"},{\"blPerm\":true,\"permCode\":\"task.detail\"}]},{\"blPerm\":true,\"permCode\":\"output\",\"permTitle\":\"报工\",\"index\":\"/productionManagement/jobBooking\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"jobBooking.custom\"},{\"blPerm\":true,\"permCode\":\"jobBooking.loadLog\"},{\"blPerm\":true,\"permCode\":\"jobBooking.detail\"},{\"blPerm\":true,\"permCode\":\"jobBooking.operationHistory\"},{\"blPerm\":true,\"permCode\":\"jobBooking.create\"},{\"blPerm\":true,\"permCode\":\"jobBooking.edit\"},{\"blPerm\":true,\"permCode\":\"jobBooking.logDetails\"}]}]},{\"blPerm\":true,\"permCode\":\"inventory.management\",\"permTitle\":\"库存管理\",\"iconName\":\"icon-kucunguanli\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"warehousing.list\",\"permTitle\":\"入库单\",\"index\":\"/stockManagement/inStock\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"inStock.create\"},{\"blPerm\":true,\"permCode\":\"inStock.edit\"}]},{\"blPerm\":true,\"permCode\":\"outbound.order\",\"permTitle\":\"出库单\",\"index\":\"/stockManagement/outStock\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"outStock.create\"},{\"blPerm\":true,\"permCode\":\"outStock.edit\"}]},{\"blPerm\":true,\"permCode\":\"inventory.details.report\",\"permTitle\":\"库存收发明细\",\"index\":\"/stockManagement/stockDetail\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"stock.balanceReport\",\"permTitle\":\"库存余额\",\"index\":\"/stockManagement/balanceReport\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"base.data\",\"permTitle\":\"基础数据\",\"iconName\":\"icon-jichushuju-\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"product.def\",\"permTitle\":\"产品定义\",\"index\":\"/basicData/productDefinition\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"productDefinition.create\"},{\"blPerm\":true,\"permCode\":\"productDefinition.loadLog\"},{\"blPerm\":true,\"permCode\":\"productDefinition.logDetail\"}]},{\"blPerm\":true,\"permCode\":\"productDefinition.materials\",\"permTitle\":\"物料清单\",\"index\":\"/basicData/materials\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"productDefinition.materials.create\"},{\"blPerm\":true,\"permCode\":\"productDefinition.materials.edit\"},{\"blPerm\":true,\"permCode\":\"productDefinition.materials.loadLog\"},{\"blPerm\":true,\"permCode\":\"productDefinition.materials.logDetail\"}]},{\"blPerm\":true,\"permCode\":\"unit.def\",\"permTitle\":\"单位\",\"index\":\"/basicData/unit\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"defect.def\",\"permTitle\":\"不良品项\",\"index\":\"/basicData/irregular\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"irregular.loadLog\"}]},{\"blPerm\":true,\"permCode\":\"process.def\",\"permTitle\":\"工序\",\"index\":\"/basicData/procedure\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"procedure.create\"},{\"blPerm\":true,\"permCode\":\"procedure.loadLog\"},{\"blPerm\":true,\"permCode\":\"procedure.SOPTemplateDefault\"},{\"blPerm\":true,\"permCode\":\"procedure.logDetail\"},{\"blPerm\":true,\"permCode\":\"procedure.SOPTemplate\"}]},{\"blPerm\":true,\"permCode\":\"process.routing.def\",\"permTitle\":\"工艺路线\",\"index\":\"/basicData/bom\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"bom.loadLog\"},{\"blPerm\":true,\"permCode\":\"bom.create\"},{\"blPerm\":true,\"permCode\":\"bom.detail\"},{\"blPerm\":true,\"permCode\":\"bom.logDetail\"}]},{\"blPerm\":true,\"permCode\":\"salary.config.def\",\"permTitle\":\"绩效工资配置\",\"index\":\"/basicData/meritPay\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"meritPay.loadLog\"},{\"blPerm\":true,\"permCode\":\"meritPay.meritPayRules\"},{\"blPerm\":true,\"permCode\":\"meritPay.create\"},{\"blPerm\":true,\"permCode\":\"meritPay.logDetail\"}]}]},{\"blPerm\":true,\"iconName\":\"icon-shebei\",\"permCode\":\"equipment.status\",\"permTitle\":\"设备看板\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"equipmentBoard.screen\",\"permTitle\":\"设备状态\",\"index\":\"/equipmentBoard/screen\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"equipmentBoard.screen.oee\"}]},{\"blPerm\":true,\"permCode\":\"equipmentBoard.exceptionReport\",\"permTitle\":\"异常报表\",\"index\":\"/equipmentBoard/exceptionReport\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"equipmentBoard.operationRate\",\"permTitle\":\"开机率看板\",\"index\":\"/equipmentBoard/operationRate\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"equipmentBoard.oeeCount\",\"permTitle\":\"计数看板\",\"index\":\"/equipmentBoard/oeeCount\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"equipmentBoard.countReport\",\"permTitle\":\"计数报表\",\"index\":\"/equipmentBoard/countReport\",\"routerMenu\":[]}]},{\"blPerm\":true,\"iconName\":\"icon-deng\",\"permCode\":\"lamp.management\",\"permTitle\":\"联络灯管理\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"lampManagement.reportForm\",\"permTitle\":\"联络灯报表\",\"index\":\"/lampManagement/reportForm\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"lampManagement.board\",\"permTitle\":\"联络灯看板\",\"index\":\"/lampManagement/board\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"custom.field\",\"permTitle\":\"自定义配置\",\"iconName\":\"iconfont icon-zidingyipeizhi\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"product.custom.field\",\"permTitle\":\"产品\",\"index\":\"/customFields/material\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"product.field.create\"},{\"blPerm\":true,\"permCode\":\"product.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"process.custom.field\",\"permTitle\":\"工序\",\"index\":\"/customFields/process\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"process.field.create\"},{\"blPerm\":true,\"permCode\":\"process.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"project.custom.field\",\"permTitle\":\"工单\",\"index\":\"/customFields/workOrder\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"project.field.create\"},{\"blPerm\":true,\"permCode\":\"project.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"output.custom.field\",\"permTitle\":\"报工\",\"index\":\"/customFields/reportWork\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"output.field.create\"},{\"blPerm\":true,\"permCode\":\"output.field.edit\"},{\"blPerm\":true,\"permCode\":\"output.field.checkRules\"}]},{\"blPerm\":true,\"permCode\":\"stock.custom.field\",\"permTitle\":\"出入库单\",\"index\":\"/customFields/inventoryManagement\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"stock.field.create\"},{\"blPerm\":true,\"permCode\":\"stock.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"stock.detail.custom.field\",\"permTitle\":\"出入库明细\",\"index\":\"/customFields/inventoryDetails\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"stock.detail.field.create\"},{\"blPerm\":true,\"permCode\":\"stock.detail.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"user.custom.field\",\"permTitle\":\"用户\",\"index\":\"/customFields/user\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"user.field.create\"},{\"blPerm\":true,\"permCode\":\"user.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"form.custom.field\",\"permTitle\":\"自定义编号规则\",\"index\":\"/customFields/numberCustomField\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"statistics\",\"permTitle\":\"报表\",\"iconName\":\"icon-shujubaobiao\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"production.statistics\",\"permTitle\":\"产量统计\",\"index\":\"/reportForm/outputStatistics\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"staff.performance.statistics\",\"permTitle\":\"员工绩效\",\"index\":\"/reportForm/staffPerformance\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"salary.statistics\",\"permTitle\":\"工资报表\",\"index\":\"/reportForm/salaryForm\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"defects.statistics\",\"permTitle\":\"不良品项分布\",\"index\":\"/reportForm/irregularSpread\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"defects.detail.statistics\",\"permTitle\":\"不良品项汇总\",\"index\":\"/reportForm/irregularGather\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"project.statistics\",\"permTitle\":\"生产报表\",\"index\":\"/reportForm/productForm\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"in.process.statistics\",\"permTitle\":\"在制品报表\",\"index\":\"/reportForm/goodsForm\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"system.conf\",\"permTitle\":\"系统配置\",\"iconName\":\"icon-xitongpeizhi\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"dept.system.conf\",\"permTitle\":\"部门\",\"index\":\"/stmConfiguration/department\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"user.system.conf\",\"permTitle\":\"用户\",\"index\":\"/stmConfiguration/user\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"user.loadLog\"},{\"blPerm\":true,\"permCode\":\"user.logDetail\"}]},{\"blPerm\":true,\"permCode\":\"dev.system.info.group\",\"permTitle\":\"设备\",\"index\":\"/stmConfiguration/device\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"dev.system.info.info\"}]},{\"blPerm\":true,\"permCode\":\"org.system.conf\",\"permTitle\":\"工厂\",\"index\":\"/stmConfiguration/factory\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"sub.workshop.kanban\",\"permTitle\":\"车间看板\",\"iconName\":\"icon-menu_chejiankanban\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"workshop.procedureNotice\",\"permTitle\":\"工序看板\",\"index\":\"/farmBoard/procedureNotice\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"workshop.kanban.1\",\"permTitle\":\"车间看板\",\"index\":\"/board\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"workshop.kanban.2\",\"permTitle\":\"工单执行进度看板\",\"index\":\"/orderProgress\",\"routerMenu\":[]}]}]', 0);
INSERT INTO `user_menu` (`id`, `user_id`, `menu`, `type`) VALUES (2, 0, '{\"project\":[{\"blPerm\":true,\"permCode\":\"project.revert\"},{\"blPerm\":true,\"permCode\":\"project.modify\"},{\"blPerm\":true,\"permCode\":\"project.end\"},{\"blPerm\":true,\"permCode\":\"project.start\"},{\"blPerm\":true,\"permCode\":\"project.quick\"}],\"task\":[{\"blPerm\":true,\"permCode\":\"task.adjustment\"},{\"blPerm\":true,\"permCode\":\"task.quick\"},{\"blPerm\":true,\"permCode\":\"task.distribution\"},{\"blPerm\":true,\"permCode\":\"task.pick.up.cancel\"}],\"output\":[{\"blPerm\":true,\"permCode\":\"output.agent\"},{\"blPerm\":true,\"permCode\":\"output.approval\"},{\"blPerm\":true,\"permCode\":\"output.delete\"},{\"blPerm\":true,\"permCode\":\"output.modify\"},{\"blPerm\":true,\"permCode\":\"output.query\"}],\"nimble\":[{\"blPerm\":true,\"permCode\":\"nimble.project.add\"},{\"blPerm\":true,\"permCode\":\"nimble.production.task\"},{\"blPerm\":true,\"permCode\":\"nimble.output.add\"},{\"blPerm\":true,\"permCode\":\"nimble.sales\"},{\"blPerm\":true,\"permCode\":\"nimble.production.plan\"},{\"blPerm\":true,\"permCode\":\"nimble.todady.output\"},{\"blPerm\":true,\"permCode\":\"nimble.today.defects\"},{\"blPerm\":true,\"permCode\":\"nimble.stock.in\"},{\"blPerm\":true,\"permCode\":\"nimble.stock.out\"},{\"blPerm\":true,\"permCode\":\"nimble.stock.amount\"},{\"blPerm\":true,\"permCode\":\"nimble.info\"}],\"dashboard\":[{\"blPerm\":true,\"permCode\":\"dashboard\"}],\"user\":[{\"blPerm\":true,\"permCode\":\"user.about.motone\"},{\"blPerm\":true,\"permCode\":\"user.change.password\"},{\"blPerm\":true,\"permCode\":\"user.configuration.wizard\"}]}', 1);
INSERT INTO `user_menu` (`id`, `user_id`, `menu`, `type`) VALUES (3, 1, '[{\"blPerm\":true,\"permCode\":\"home.page\",\"permTitle\":\"主页\",\"iconName\":\"icon-shouye\",\"index\":\"/home\",\"submenu\":[]},{\"blPerm\":true,\"permCode\":\"production.management\",\"permTitle\":\"生产管理\",\"iconName\":\"icon-shengchanguanli\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"assembleOrder\",\"permTitle\":\"装配工单\",\"index\":\"/productionManagement/assembleOrder\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"assembleOrder.edit\"},{\"blPerm\":true,\"permCode\":\"assembleOrder.create\"},{\"blPerm\":true,\"permCode\":\"assembleOrder.copy\"}]},{\"blPerm\":true,\"permCode\":\"salesOrder\",\"permTitle\":\"销售订单\",\"index\":\"/productionManagement/salesOrder\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"salesOrder.create\"},{\"blPerm\":true,\"permCode\":\"salesOrder.edit\"},{\"blPerm\":true,\"permCode\":\"salesOrder.copy\"}]},{\"blPerm\":true,\"chooseSchemeChecked\":true,\"filtrateConfig\":[{\"blPerm\":true,\"permCode\":\"button.createOrder\",\"permTitle\":\"创建工单\"},{\"blPerm\":true,\"permCode\":\"button.batchStart\",\"permTitle\":\"批量开始\"},{\"blPerm\":true,\"permCode\":\"button.batchRecall\",\"permTitle\":\"批量撤回\"},{\"blPerm\":true,\"permCode\":\"button.batchDelete\",\"permTitle\":\"批量删除\"},{\"blPerm\":true,\"permCode\":\"button.batchEnd\",\"permTitle\":\"批量结束\"},{\"blPerm\":true,\"permCode\":\"button.batchCancel\",\"permTitle\":\"批量取消\"},{\"blPerm\":true,\"permCode\":\"button.batchPrint\",\"permTitle\":\"批量打印\"},{\"blPerm\":true,\"permCode\":\"button.export\",\"permTitle\":\"导出\"},{\"blPerm\":true,\"permCode\":\"button.import\",\"permTitle\":\"导入\"},{\"blPerm\":true,\"permCode\":\"button.editPrintMould\",\"permTitle\":\"编辑打印模板\"},{\"blPerm\":true,\"permCode\":\"button.cardSet\",\"permTitle\":\"移动端卡片设置\"},{\"blPerm\":true,\"permCode\":\"button.columnConfig\",\"permTitle\":\"列配置\"},{\"blPerm\":true,\"permCode\":\"button.edit\",\"permTitle\":\"编辑\"},{\"blPerm\":true,\"permCode\":\"button.start\",\"permTitle\":\"开始\"},{\"blPerm\":true,\"permCode\":\"button.recall\",\"permTitle\":\"撤回\"},{\"blPerm\":true,\"permCode\":\"button.end\",\"permTitle\":\"结束\"},{\"blPerm\":true,\"permCode\":\"button.cancel\",\"permTitle\":\"取消\"},{\"blPerm\":true,\"permCode\":\"button.print\",\"permTitle\":\"打印\"},{\"blPerm\":true,\"permCode\":\"button.copy\",\"permTitle\":\"复制\"},{\"blPerm\":true,\"permCode\":\"button.delete\",\"permTitle\":\"删除\"}],\"permCode\":\"project\",\"permTitle\":\"工单\",\"index\":\"/productionManagement/workOrder\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"project.create\"},{\"blPerm\":true,\"permCode\":\"project.loadlog\"},{\"blPerm\":true,\"permCode\":\"project.custom\"},{\"blPerm\":true,\"permCode\":\"project.detail\"},{\"blPerm\":true,\"permCode\":\"project.record\"},{\"blPerm\":true,\"permCode\":\"project.copy\"},{\"blPerm\":true,\"permCode\":\"project.logDetails\"}]},{\"blPerm\":true,\"permCode\":\"project.task\",\"permTitle\":\"任务\",\"index\":\"/productionManagement/task\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"task.custom\"},{\"blPerm\":true,\"permCode\":\"task.edit\"},{\"blPerm\":true,\"permCode\":\"task.detail\"}]},{\"blPerm\":true,\"permCode\":\"output\",\"permTitle\":\"报工\",\"index\":\"/productionManagement/jobBooking\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"jobBooking.custom\"},{\"blPerm\":true,\"permCode\":\"jobBooking.loadLog\"},{\"blPerm\":true,\"permCode\":\"jobBooking.detail\"},{\"blPerm\":true,\"permCode\":\"jobBooking.operationHistory\"},{\"blPerm\":true,\"permCode\":\"jobBooking.create\"},{\"blPerm\":true,\"permCode\":\"jobBooking.edit\"},{\"blPerm\":true,\"permCode\":\"jobBooking.logDetails\"}]}]},{\"blPerm\":true,\"permCode\":\"inventory.management\",\"permTitle\":\"库存管理\",\"iconName\":\"icon-kucunguanli\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"warehousing.list\",\"permTitle\":\"入库单\",\"index\":\"/stockManagement/inStock\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"inStock.create\"},{\"blPerm\":true,\"permCode\":\"inStock.edit\"}]},{\"blPerm\":true,\"permCode\":\"outbound.order\",\"permTitle\":\"出库单\",\"index\":\"/stockManagement/outStock\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"outStock.create\"},{\"blPerm\":true,\"permCode\":\"outStock.edit\"}]},{\"blPerm\":true,\"permCode\":\"inventory.details.report\",\"permTitle\":\"库存收发明细\",\"index\":\"/stockManagement/stockDetail\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"stock.balanceReport\",\"permTitle\":\"库存余额\",\"index\":\"/stockManagement/balanceReport\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"base.data\",\"permTitle\":\"基础数据\",\"iconName\":\"icon-jichushuju-\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"product.def\",\"permTitle\":\"产品定义\",\"index\":\"/basicData/productDefinition\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"productDefinition.create\"},{\"blPerm\":true,\"permCode\":\"productDefinition.loadLog\"},{\"blPerm\":true,\"permCode\":\"productDefinition.logDetail\"}]},{\"blPerm\":true,\"permCode\":\"productDefinition.materials\",\"permTitle\":\"物料清单\",\"index\":\"/basicData/materials\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"productDefinition.materials.create\"},{\"blPerm\":true,\"permCode\":\"productDefinition.materials.edit\"},{\"blPerm\":true,\"permCode\":\"productDefinition.materials.loadLog\"},{\"blPerm\":true,\"permCode\":\"productDefinition.materials.logDetail\"}]},{\"blPerm\":true,\"permCode\":\"unit.def\",\"permTitle\":\"单位\",\"index\":\"/basicData/unit\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"defect.def\",\"permTitle\":\"不良品项\",\"index\":\"/basicData/irregular\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"irregular.loadLog\"}]},{\"blPerm\":true,\"permCode\":\"process.def\",\"permTitle\":\"工序\",\"index\":\"/basicData/procedure\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"procedure.create\"},{\"blPerm\":true,\"permCode\":\"procedure.loadLog\"},{\"blPerm\":true,\"permCode\":\"procedure.SOPTemplateDefault\"},{\"blPerm\":true,\"permCode\":\"procedure.logDetail\"},{\"blPerm\":true,\"permCode\":\"procedure.SOPTemplate\"}]},{\"blPerm\":true,\"permCode\":\"process.routing.def\",\"permTitle\":\"工艺路线\",\"index\":\"/basicData/bom\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"bom.loadLog\"},{\"blPerm\":true,\"permCode\":\"bom.create\"},{\"blPerm\":true,\"permCode\":\"bom.detail\"},{\"blPerm\":true,\"permCode\":\"bom.logDetail\"}]},{\"blPerm\":true,\"permCode\":\"salary.config.def\",\"permTitle\":\"绩效工资配置\",\"index\":\"/basicData/meritPay\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"meritPay.loadLog\"},{\"blPerm\":true,\"permCode\":\"meritPay.meritPayRules\"},{\"blPerm\":true,\"permCode\":\"meritPay.create\"},{\"blPerm\":true,\"permCode\":\"meritPay.logDetail\"}]}]},{\"blPerm\":true,\"iconName\":\"icon-shebei\",\"permCode\":\"equipment.status\",\"permTitle\":\"设备看板\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"equipmentBoard.screen\",\"permTitle\":\"设备状态\",\"index\":\"/equipmentBoard/screen\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"equipmentBoard.screen.oee\"}]},{\"blPerm\":true,\"permCode\":\"equipmentBoard.exceptionReport\",\"permTitle\":\"异常报表\",\"index\":\"/equipmentBoard/exceptionReport\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"equipmentBoard.operationRate\",\"permTitle\":\"开机率看板\",\"index\":\"/equipmentBoard/operationRate\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"equipmentBoard.oeeCount\",\"permTitle\":\"计数看板\",\"index\":\"/equipmentBoard/oeeCount\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"equipmentBoard.countReport\",\"permTitle\":\"计数报表\",\"index\":\"/equipmentBoard/countReport\",\"routerMenu\":[]}]},{\"blPerm\":true,\"iconName\":\"icon-deng\",\"permCode\":\"lamp.management\",\"permTitle\":\"联络灯管理\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"lampManagement.reportForm\",\"permTitle\":\"联络灯报表\",\"index\":\"/lampManagement/reportForm\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"lampManagement.board\",\"permTitle\":\"联络灯看板\",\"index\":\"/lampManagement/board\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"custom.field\",\"permTitle\":\"自定义配置\",\"iconName\":\"iconfont icon-zidingyipeizhi\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"product.custom.field\",\"permTitle\":\"产品\",\"index\":\"/customFields/material\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"product.field.create\"},{\"blPerm\":true,\"permCode\":\"product.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"process.custom.field\",\"permTitle\":\"工序\",\"index\":\"/customFields/process\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"process.field.create\"},{\"blPerm\":true,\"permCode\":\"process.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"project.custom.field\",\"permTitle\":\"工单\",\"index\":\"/customFields/workOrder\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"project.field.create\"},{\"blPerm\":true,\"permCode\":\"project.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"output.custom.field\",\"permTitle\":\"报工\",\"index\":\"/customFields/reportWork\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"output.field.create\"},{\"blPerm\":true,\"permCode\":\"output.field.edit\"},{\"blPerm\":true,\"permCode\":\"output.field.checkRules\"}]},{\"blPerm\":true,\"permCode\":\"stock.custom.field\",\"permTitle\":\"出入库单\",\"index\":\"/customFields/inventoryManagement\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"stock.field.create\"},{\"blPerm\":true,\"permCode\":\"stock.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"stock.detail.custom.field\",\"permTitle\":\"出入库明细\",\"index\":\"/customFields/inventoryDetails\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"stock.detail.field.create\"},{\"blPerm\":true,\"permCode\":\"stock.detail.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"user.custom.field\",\"permTitle\":\"用户\",\"index\":\"/customFields/user\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"user.field.create\"},{\"blPerm\":true,\"permCode\":\"user.field.edit\"}]},{\"blPerm\":true,\"permCode\":\"form.custom.field\",\"permTitle\":\"自定义编号规则\",\"index\":\"/customFields/numberCustomField\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"statistics\",\"permTitle\":\"报表\",\"iconName\":\"icon-shujubaobiao\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"production.statistics\",\"permTitle\":\"产量统计\",\"index\":\"/reportForm/outputStatistics\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"staff.performance.statistics\",\"permTitle\":\"员工绩效\",\"index\":\"/reportForm/staffPerformance\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"salary.statistics\",\"permTitle\":\"工资报表\",\"index\":\"/reportForm/salaryForm\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"defects.statistics\",\"permTitle\":\"不良品项分布\",\"index\":\"/reportForm/irregularSpread\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"defects.detail.statistics\",\"permTitle\":\"不良品项汇总\",\"index\":\"/reportForm/irregularGather\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"project.statistics\",\"permTitle\":\"生产报表\",\"index\":\"/reportForm/productForm\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"in.process.statistics\",\"permTitle\":\"在制品报表\",\"index\":\"/reportForm/goodsForm\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"system.conf\",\"permTitle\":\"系统配置\",\"iconName\":\"icon-xitongpeizhi\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"dept.system.conf\",\"permTitle\":\"部门\",\"index\":\"/stmConfiguration/department\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"user.system.conf\",\"permTitle\":\"用户\",\"index\":\"/stmConfiguration/user\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"user.loadLog\"},{\"blPerm\":true,\"permCode\":\"user.logDetail\"}]},{\"blPerm\":true,\"permCode\":\"dev.system.info.group\",\"permTitle\":\"设备\",\"index\":\"/stmConfiguration/device\",\"routerMenu\":[{\"blPerm\":true,\"permCode\":\"dev.system.info.info\"}]},{\"blPerm\":true,\"permCode\":\"org.system.conf\",\"permTitle\":\"工厂\",\"index\":\"/stmConfiguration/factory\",\"routerMenu\":[]}]},{\"blPerm\":true,\"permCode\":\"sub.workshop.kanban\",\"permTitle\":\"车间看板\",\"iconName\":\"icon-menu_chejiankanban\",\"submenu\":[{\"blPerm\":true,\"permCode\":\"workshop.procedureNotice\",\"permTitle\":\"工序看板\",\"index\":\"/farmBoard/procedureNotice\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"workshop.kanban.1\",\"permTitle\":\"车间看板\",\"index\":\"/board\",\"routerMenu\":[]},{\"blPerm\":true,\"permCode\":\"workshop.kanban.2\",\"permTitle\":\"工单执行进度看板\",\"index\":\"/orderProgress\",\"routerMenu\":[]}]}]', 0);
INSERT INTO `user_menu` (`id`, `user_id`, `menu`, `type`) VALUES (4, 1, '{\"project\":[{\"blPerm\":true,\"permCode\":\"project.revert\"},{\"blPerm\":true,\"permCode\":\"project.modify\"},{\"blPerm\":true,\"permCode\":\"project.end\"},{\"blPerm\":true,\"permCode\":\"project.start\"},{\"blPerm\":true,\"permCode\":\"project.quick\"}],\"task\":[{\"blPerm\":true,\"permCode\":\"task.adjustment\"},{\"blPerm\":true,\"permCode\":\"task.quick\"},{\"blPerm\":true,\"permCode\":\"task.distribution\"},{\"blPerm\":true,\"permCode\":\"task.pick.up.cancel\"}],\"output\":[{\"blPerm\":true,\"permCode\":\"output.agent\"},{\"blPerm\":true,\"permCode\":\"output.approval\"},{\"blPerm\":true,\"permCode\":\"output.delete\"},{\"blPerm\":true,\"permCode\":\"output.modify\"},{\"blPerm\":true,\"permCode\":\"output.query\"}],\"nimble\":[{\"blPerm\":true,\"permCode\":\"nimble.project.add\"},{\"blPerm\":true,\"permCode\":\"nimble.production.task\"},{\"blPerm\":true,\"permCode\":\"nimble.output.add\"},{\"blPerm\":true,\"permCode\":\"nimble.sales\"},{\"blPerm\":true,\"permCode\":\"nimble.production.plan\"},{\"blPerm\":true,\"permCode\":\"nimble.todady.output\"},{\"blPerm\":true,\"permCode\":\"nimble.today.defects\"},{\"blPerm\":true,\"permCode\":\"nimble.stock.in\"},{\"blPerm\":true,\"permCode\":\"nimble.stock.out\"},{\"blPerm\":true,\"permCode\":\"nimble.stock.amount\"},{\"blPerm\":true,\"permCode\":\"nimble.info\"}],\"dashboard\":[{\"blPerm\":true,\"permCode\":\"dashboard\"}],\"user\":[{\"blPerm\":true,\"permCode\":\"user.about.motone\"},{\"blPerm\":true,\"permCode\":\"user.change.password\"},{\"blPerm\":true,\"permCode\":\"user.configuration.wizard\"}]}', 1);
COMMIT;

-- ----------------------------
-- Table structure for wages
-- ----------------------------
DROP TABLE IF EXISTS `wages`;
CREATE TABLE `wages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `unit_price` decimal(10,2) DEFAULT NULL COMMENT '单价',
  `output` int DEFAULT NULL COMMENT '标准产出',
  `working_hours` varchar(45) DEFAULT NULL COMMENT '标准工时',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `create_id` int DEFAULT NULL COMMENT '创建人id',
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `other` text COMMENT '自定义',
  `del_flag` tinyint DEFAULT '1' COMMENT '0/1 已删除/正常',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb3 COMMENT='工资配置';

-- ----------------------------
-- Records of wages
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_condition
-- ----------------------------
DROP TABLE IF EXISTS `work_condition`;
CREATE TABLE `work_condition` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL COMMENT '0/1/2/3/4 (工单/任务/库存余额/入库/出库)  \n工单/任务',
  `user_id` int NOT NULL COMMENT '用户id',
  `login_account` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL COMMENT '登录账户',
  `search_condition` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin COMMENT 'h5端工单筛选条件json',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='h5端筛选条件表';

-- ----------------------------
-- Records of work_condition
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_order
-- ----------------------------
DROP TABLE IF EXISTS `work_order`;
CREATE TABLE `work_order` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(128) DEFAULT NULL,
  `product_id` int DEFAULT NULL COMMENT '产品id',
  `start_time` timestamp NULL DEFAULT NULL COMMENT '计划开始时间',
  `end_time` timestamp NULL DEFAULT NULL COMMENT '计划结束时间',
  `state` int DEFAULT '0' COMMENT '状态 0/1/2/3/4  未开始/执行中/已结束/已取消/暂停中',
  `planed_number` decimal(16,6) DEFAULT '0.000000' COMMENT '计划数',
  `actual_number` decimal(16,6) DEFAULT '0.000000' COMMENT '实际数',
  `good_product_number` decimal(16,6) DEFAULT '0.000000' COMMENT '良品数',
  `bad_product_number` decimal(16,6) DEFAULT '0.000000' COMMENT '不良品数',
  `reported_hours` varchar(45) DEFAULT '-' COMMENT '报工时长',
  `process_id` varchar(1024) DEFAULT NULL COMMENT '工序ids',
  `create_id` int DEFAULT NULL COMMENT '创建人',
  `edit_id` int DEFAULT NULL COMMENT '修改人',
  `actual_start_time` timestamp NULL DEFAULT NULL COMMENT '实际开始时间',
  `actual_end_time` timestamp NULL DEFAULT NULL COMMENT '实际结束时间',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `comment` text COMMENT '备注',
  `qr` varchar(128) DEFAULT NULL COMMENT '二维码',
  `client_name` varchar(45) DEFAULT NULL COMMENT '客户名称',
  `other` text,
  `is_urgent` int DEFAULT NULL COMMENT '是否加急（0不加急  1加急）',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `search` (`code`,`product_id`,`planed_number`,`actual_number`,`good_product_number`,`bad_product_number`,`start_time`,`end_time`,`actual_start_time`,`actual_end_time`,`state`),
  KEY `code` (`code`) USING BTREE,
  FULLTEXT KEY `comment` (`comment`)
) ENGINE=InnoDB AUTO_INCREMENT=1248 DEFAULT CHARSET=utf8mb3 COMMENT='工单';

-- ----------------------------
-- Records of work_order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for work_report
-- ----------------------------
DROP TABLE IF EXISTS `work_report`;
CREATE TABLE `work_report` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mission_id` int DEFAULT NULL,
  `report_number` decimal(16,6) DEFAULT NULL COMMENT '报工数量',
  `pricing_method` int DEFAULT NULL COMMENT '0/1 计件/计时',
  `wages_id` int DEFAULT NULL COMMENT '绩效工资id',
  `good_product_number` decimal(16,6) DEFAULT NULL,
  `bad_product_number` decimal(16,6) DEFAULT NULL,
  `produce_user` int DEFAULT NULL COMMENT '报工人id',
  `report_start_time` timestamp NULL DEFAULT NULL COMMENT '报工开始时间',
  `report_end_time` timestamp NULL DEFAULT NULL COMMENT '报工结束时间',
  `verify_state` int DEFAULT NULL COMMENT '0/1 未审批/已审批',
  `verify_time` timestamp NULL DEFAULT NULL,
  `verify_user` int DEFAULT NULL,
  `unfinished_reason` varchar(128) DEFAULT NULL COMMENT '未完成原因\n',
  `estimate_wage` decimal(10,2) DEFAULT NULL COMMENT '预计工资',
  `other` text,
  `actual_efficiency` varchar(45) DEFAULT NULL COMMENT '实际效率',
  `standard_rate` varchar(45) DEFAULT NULL COMMENT '达标率',
  `standard_efficiency` varchar(45) DEFAULT NULL COMMENT '标准效率',
  `create_time` varchar(45) DEFAULT NULL COMMENT '创建时间',
  `factory_id` int DEFAULT NULL COMMENT '工厂id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `search` (`mission_id`,`wages_id`,`produce_user`)
) ENGINE=InnoDB AUTO_INCREMENT=451 DEFAULT CHARSET=utf8mb3 COMMENT='报工';

-- ----------------------------
-- Records of work_report
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
